package operator;

public class op1 {
    public static void main(String[] args) {
        // ++ 自增运算符
        int a = 3;
        int b = ++a; //先执行 ++a 相当于 a = a+1 => a=4
        // 再执行 b=a => b=4
        // int b = (a = a + 1);
        System.out.println("b=" + b);//b=4
        System.out.println("a=" + a);//a=4

        int m = 10;
        int n = m++;//先把m的值赋值给n => n= 10
        //接着m再进行自增,m=m+1 => m=11
        //int n = m;
        //m=m+1;
        System.out.println("m=" + m);//m=11
        System.out.println("n=" + n);//n=10
    }
}
